package com.epam.training.concurrency.first.task5;

import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.epam.training.concurrency.first.task3.CircularBuffer;

/**
 * 
 * @author Bogdan
 *
 */
public class TestThread implements Runnable {

	final int number;

	TestThread(int number) {
		this.number = number;
	}

	@Override
	public void run() {

		System.out.format("MESSAGE: %s%n", "Thread " + number + " execute");

		Random random = new Random();
		try {
			Thread.sleep(random.nextInt(5000));
		} catch (InterruptedException e) {
			Logger.getLogger(CircularBuffer.class.getName()).log(
					Level.SEVERE, null, e);
		}
	}
}
